#include <iostream>
#include <vector>
using namespace std;

class Solution {
public:
    double Power(double base, int exponent) {
        bool sign = false;
        if (exponent < 0) {
            exponent = -exponent;
            sign = true;
        }
        double d = sign ? 1 / base : base;
        double r = 1.0;
        while (exponent != 0) {
            if (exponent & 1) {
                r *= d;
            }
            exponent >>= 1;
            d *= d;
        }
        return r;
    }
};

int main() {
    cout << Solution().Power(2.0, 10) << endl;
    cout << Solution().Power(2.0, 0) << endl;
    cout << Solution().Power(2.0, -2) << endl;
    return 0;
}